#import "JoyfulBalloonController.h"
        
#import "JoyfulBalloonModel.h"
#import "JoyfulBalloonCell.h"
#import "Masonry.h"

@interface JoyfulBalloonController () <UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, strong) UITableView *whimsyQuirkBreezeTableView;
@property (nonatomic, strong) NSMutableArray *zestModels;

@end

@implementation JoyfulBalloonController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self zephyrInitui];
	[self unwindReverieloadData];
}


//: 获取数据模型
- (void)unwindReverieloadData {
	
}

- (UITableView *)figHandleTableView {
    if (!_whimsyQuirkBreezeTableView) {
        _whimsyQuirkBreezeTableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
        _whimsyQuirkBreezeTableView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
        _whimsyQuirkBreezeTableView.estimatedRowHeight = 0;
        _whimsyQuirkBreezeTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        _whimsyQuirkBreezeTableView.contentInset = UIEdgeInsetsMake(16, 0, 16, 0);
        _whimsyQuirkBreezeTableView.delegate = self;
        _whimsyQuirkBreezeTableView.dataSource = self;
        _whimsyQuirkBreezeTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
        _whimsyQuirkBreezeTableView.showsVerticalScrollIndicator = NO;
        _whimsyQuirkBreezeTableView.showsHorizontalScrollIndicator = NO;
        _whimsyQuirkBreezeTableView.backgroundColor = UIColor.clearColor;
    }
    return _whimsyQuirkBreezeTableView;
}

//: 懒加载数据模型数组
- (NSMutableArray *)zestModels {
	if (!_zestModels) {
		_zestModels = [NSMutableArray array];
	}
	return _zestModels;
}

//: 初始化页面UI
- (void)zephyrInitui {

	[self.view addSubview:self.whimsyQuirkBreezeTableView];
	[self.whimsyQuirkBreezeTableView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.leading.trailing.equalTo(self.view);
		make.top.equalTo(self.view);
		make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
	}];
}


#pragma mark - UITableView DataSource 
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.zestModels.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    JoyfulBalloonCell *wondermentMotionKeyhole = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([JoyfulBalloonCell class])];
    if (wondermentMotionKeyhole == nil) {
        wondermentMotionKeyhole = [[JoyfulBalloonCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:NSStringFromClass([JoyfulBalloonCell class])];
    }
    wondermentMotionKeyhole.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return wondermentMotionKeyhole;
}


#pragma mark - UITableView Delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // cell tap action
}


@end
